<template>
  <div class="Showcase1">
    <div class="shadow-box">
      <img class="shadow-left" :src="publicUrls + 'free/style5/Showcase4dy1.webp'" alt="" />
      <div
        class="shadow-center" 
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4dy2.webp'})`,
        }"
      ></div> 
      <img class="shadow-right" :src="publicUrls + 'free/style5/Showcase4dy3.webp'" alt="" />
    </div>
    <div class="Showcase1-top"> 
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style5/Showcase4bg1.webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4bg2.webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style5/Showcase4bg3.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <div
        class="Showcase1-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4bg4.webp'})`,
        }"
      ></div>
      <div class="Showcase1-center-center"></div>
      <div
        class="Showcase1-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4bg5.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase1-bottom">
      <div
        :style="{ 
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 0.6875)}rem`,
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4NameBg.webp'})`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <p class="name-box">
          {{ item.name }}
        </p>
      </div>

      <img
        class="Showcase1-bottom-left"
        :src="publicUrls + 'free/style5/Showcase4bg6.webp'"
        alt=""
      />
      <div
        class="Showcase1-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style5/Showcase4bg7.webp'})`,
        }"
      >
        <img
          class="Showcase1-bottom-center-1"
          :src="publicUrls + 'free/style5/Showcase3bg9.webp'"
          alt=""
        />
        <img
          class="Showcase1-bottom-center-2"
          :src="publicUrls + 'free/style5/Showcase3bg10.webp'"
          alt=""
        />
      </div>
      <img
        class="Showcase1-bottom-right"
        :src="publicUrls + 'free/style5/Showcase4bg8.webp'"
        alt=""
      />
    </div>
    <!-- Showcase1Topleft -->
  </div>
</template>    

<script lang="ts">
export default defineComponent({
  name: 'style4',
});
</script> 
   
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }
 
  return x;
}; 
</script>  

<style scoped lang="less"> 
.Showcase1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 420px; 
  min-width: 205px;
  //  -webkit-box-reflect: below -0% linear-gradient(transparent, rgba(0, 0, 0, 0.2));
}
.Showcase1-top {
  display: flex;
  width: 100%;
  height: 19px;
}
.Showcase1-top-left {
  width: 56px;
  height: 19px;
}
.Showcase1-top-center {
  flex: 1;
  height: 19px;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase1-top-right {
  width: 54px;
  height: 19px;
}
.Showcase1-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 170px);
}
.ex-item {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 53px;
  width: 99px;
  height: 56px;
  z-index: 30;
  background: rgba(216, 224, 220, 1);
  border: 1px solid rgba(126, 164, 154, 1);
}
.name-box { 
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 限制显示的文本行数为2 */
  overflow: hidden; /* 隐藏超出部分 */
  text-overflow: ellipsis; /* 使用省略号表示被截断的文本 */
  width: 91px;
  max-height: 36px;
  font-family: SourceHanSerifCN-Bold;
  font-size: 16px; 
  color: rgba(63, 95, 92, 1); 
  line-height: 18px;
}
.Showcase1-center-left {
  width: 56px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase1-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase1-center-right {
  width: 54px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.Showcase1-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 160px;
}
.Showcase1-bottom-left {
  width: 56px;
  height: 160px;
}
.Showcase1-bottom-center {
  position: relative;
  flex: 1;
  height: 160px;
  background-repeat: repeat;
  background-size: auto 100%;
  .Showcase1-bottom-center-1 {
    position: absolute;
    top: 37px;
    left: 0;
    width: 45px;
    height: 83px;
    object-fit: contain;
  }
  .Showcase1-bottom-center-2 {
    position: absolute;
    bottom: 21px;
    right: 0;
    width: 45px;
    height: 83px; 
    object-fit: contain;
  }
}
.Showcase1-bottom-right {
  width: 54px;
  height: 160px;
}
.shadow-box {
  display: flex;
  align-items: flex-end;
  position: absolute;
  bottom: -420px;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 440px;
  opacity: .15;
}
.shadow-left {
  width: 56px;
  height: 420px;
}
.shadow-center {
  flex: 1;
  height: 420px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-right {
  width: 54px;
  height: 440px;
}
</style>